package com.learning_paicoding.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户登录表
 * </p>
 *
 * @author hph
 * @since 2025-07-06
 */
@Data
@Accessors(chain = true)
@TableName("user")
@Schema(description = "用户登录表")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "第三方用户ID")
    @TableField("third_account_id")
    private String thirdAccountId;

    @Schema(description = "用户名")
    @TableField("user_name")
    private String userName;

    @Schema(description = "手机号")
    @TableField("telephone")
    private String telephone;

    @Schema(description = "密码")
    @TableField("password")
    private String password;

    @JsonIgnore
    @Schema(description = "盐值")
    @TableField("salt")
    private String salt;

    @Schema(description = "登录方式: 0-微信登录，1-账号密码登录")
    @TableField("login_type")
    private int loginType;

    @Schema(description = "是否删除")
    @TableField("deleted")
    private int deleted;

    @Schema(description = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @Schema(description = "最后更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;
}